package com.eastelsoft.smartiot.bssserver.model;

public class ErrorJsonBean {

	private int ecode =0;
	private String emsg= "success";	
	/**
	 * 根据失败原因调用该方法
	 * @param reason
	 */
	public void fail(int ecode,String reason){
		this.setEcode(ecode);
		this.setEmsg(reason);
	}
	
	/**
	 * 根据失败原因调用该方法
	 * @param reason
	 */
	public void error(int ecode,String reason,String errorInfo){
		this.setEcode(ecode);
		this.setEmsg(reason);
	}
	/**
	 * 根据失败原因调用该方法
	 * @param reason
	 */
	public void success(String reason){
		this.setEcode(0);
		this.setEmsg(reason);
	}
	
	


	public int getEcode() {
		return ecode;
	}

	public void setEcode(int ecode) {
		this.ecode = ecode;
	}

	public String getEmsg() {
		return emsg;
	}

	public void setEmsg(String emsg) {
		this.emsg = emsg;
	}
}
